# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Thomas Hipp <thomashipp at gmail dot com>

pkgname=raft
pkgver=0.18.0
pkgrel=1
pkgdesc="C implementation of the Raft consensus protocol"
arch=('loong64' 'x86_64')
url="https://github.com/canonical/raft"
license=('LGPL3')
depends=('libuv')
options=(strip)
source=("$pkgname-$pkgver.tar.gz::https://github.com/canonical/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('a26d4a8a401d4b221336aaa5d80eb92d4b26c1be30a6194021097d9c387a3e39')

build() {
	cd "${pkgname}-${pkgver}"
	autoreconf -i
	./configure --prefix=/usr
	make
}

check() {
	cd "${pkgname}-${pkgver}"
	make check || true
}

package() {
	cd "${pkgname}-${pkgver}"
	make DESTDIR="$pkgdir/" install
	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	rm -rf "${pkgdir}/usr/bin"
}
